package net.mcreator.toolsasfood.procedures;

import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.entity.Entity;
import net.minecraft.core.BlockPos;

public class NoteTapDangShiTiGengXinKeShiProcedure {
	public static void execute(LevelAccessor world, double x, double y, double z, Entity entity) {
		if (entity == null)
			return;
		if (Blocks.AIR == (world.getBlockState(new BlockPos((int) Math.floor(x), (int) y, (int) Math.floor(z)))).getBlock()) {
			if (!entity.level.isClientSide())
				entity.discard();
		}
		if (entity.getPersistentData().getBoolean("noteTap")) {
			if (!entity.level.isClientSide())
				entity.discard();
		}
	}
}
